//
//  JoinDemandViewController.m
//  WideHelp
//
//  Created by ENERGY on 2018/8/8.
//  Copyright © 2018年 ENERGY. All rights reserved.
//

#import "JoinDemandViewController.h"
#import "JoinProjectViewController.h"
#import "ConsultView.h"
@interface JoinDemandViewController ()

@end

@implementation JoinDemandViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"计划详情";
    //右侧咨询按钮
    UIButton * naviRightBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40/WIDTH_6_SCALE, 20/WIDTH_6_SCALE)];
    [naviRightBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [naviRightBtn setTitle:@"咨询" forState:UIControlStateNormal];
    [naviRightBtn addTarget:self action:@selector(naviRightBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    naviRightBtn.titleLabel.font = DEF_FontSize_12;
    UIBarButtonItem * rightButtonItem = [[UIBarButtonItem alloc] initWithCustomView:naviRightBtn];
    self.navigationItem.rightBarButtonItem = rightButtonItem;
    //底部继续按钮
    int nextPageBtnH = 44/WIDTH_6_SCALE;
    UIButton * nextPageBtn = [[UIButton alloc] initWithFrame:CGRectMake(15/WIDTH_6_SCALE, SCREEN_HEIGHT - NAVI_HEIGHT - 20/WIDTH_6_SCALE - BOTTOM_HEIGHT - nextPageBtnH, SCREEN_WIDTH - 30/WIDTH_6_SCALE, nextPageBtnH)];
    [nextPageBtn setTitle:@"符合条件，继续" forState:UIControlStateNormal];
    nextPageBtn.titleLabel.font = DEF_FontSize_16;
    [nextPageBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [nextPageBtn setBackgroundColor:getColor(greenBGColor)];
    [nextPageBtn addTarget:self action:@selector(nextPageBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [nextPageBtn setBackgroundImage:[UIImage imageNamed:@"maself_bg"] forState:UIControlStateNormal];
    nextPageBtn.layer.cornerRadius = 4;
    nextPageBtn.layer.masksToBounds = YES;
    [self.view addSubview:nextPageBtn];
}
#pragma mark - action
- (void)nextPageBtnClick:(UIButton *)sender{
    JoinProjectViewController * vc = [[JoinProjectViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)naviRightBtnClick:(UIButton *)sender{
    NSLog(@"咨询");
    ConsultView * topView = [[ConsultView alloc] initWithFrame:self.view.frame];
    [topView show];
}


@end
